import {createBrowserRouter} from 'react-router-dom'

import { lazy } from 'react'
const Home=lazy(()=>import('@/pages/home/Index'))
const Order=lazy(()=>import('../pages/order/Index'))
const Set=lazy(()=>import('../pages/order/set/Index'))
const Zhu=lazy(()=>import('../pages/zhu/Index'))


import App from '../App'

export const Rouch=[
    {
        path:'/home/order',
        element:<Order/>,
        title:'订单',
        children:[
            {
                path:'/home/order/set',
                element:<Set/>,
                title:'设置'
            }
        ]
    },
    {
        path:'/home/zhu',
        element:<Zhu/>,
        title:'主页'
    }
]

const routes=createBrowserRouter([
    {
    path:'/',
    element:<App/>,
    children:[
        {index:true,element:<Home/>},
        {
            path:'/home',
            element:<Home/>,
            children:Rouch
        }
    ]
}
])
export default routes